<!DOCTYPE html>
<html>
<head>
    <title>管理员列表 - 后台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css" media="all">
    <script type="text/javascript" src="/static/layui/layui.js"></script>
    <style type="text/css">
        .header span{background:#009688;margin-left:30px;padding:10px;color:#ffffff;}
        .header div{border-bottom:solid 2px #009688;margin-top: 8px;}
        .header button{float:right;margin-top:-5px;}
    </style>
</head>
<body style="padding:10px; box-sizing: border-box;">
<form class="layui-form">
    <input type="hidden" name="menu_id" value="{$menu.menu_id}">
    <div class="layui-form-item">
        <label class="layui-form-label">导航名</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="label" placeholder="请输入导航名" value="{$menu.label}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="sort" placeholder="请输入排序值，值越大，越靠前" value="{$menu.sort}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="开启" {if $menu.status == 1}checked{/if}>
            <input type="radio" name="status" value="0" title="禁用" {if $menu.status != 1}checked{/if}>
        </div>
    </div>
</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="button" class="layui-btn" onclick="save()">保存</button>
    </div>
</div>
<script type="text/javascript">
    layui.use(['form'],function(){
        form = layui.form;
        $ = layui.jquery;
    });

    function save(){
        $.post('/bew/menuedit',$('form').serialize(),function(res){
            if(res.code == 0){
                layer.msg(res.message,{'icon':1});
                //1s后关闭页面
                setTimeout(function(){
                    parent.window.location.reload();
                },1000);
            }else{
                layer.msg(res.message,{'icon':2});
            }
        },'json');
    }

</script>
</body>
</html>